---map (fun,iterable)First take a look at the map () function, the map function accepts two parameters, the first parameter is the name of the function, and the second parameter is an iterative object. That is, map (fun,iterable)The map function
Map is a set interface of key-value pairs, and its implementation classes mainly include: Hashmap,treemap,hashtable and Linkedhashmap.
TREEMAP: Based on the navigablemap implementation of the red-black tree (red-black trees), the map is
1. Create a map
1) Create immutable mappings
scala> val status = Map (1, "a", 2, "B") status:scala.collection.immutable.map[int,string] = map (1, A, 2- > B) scala> val status = Map ((1, "a"), (2, "B"))
1.1 Functional programmingProcess-oriented programming: we can break down complex tasks into simple tasks by splitting large pieces of code into functions through a layer of functions, and this step-by-step decomposition can be called
Map of the C ++ custom sorting Function
BCB
Struct datekey{Unsigned _ int64 I;String S;
Bool operator {// This function specifies the sorting policy, which is sorted by NID. If NID is the same, it is sorted by strname.// If (NID // If (nid =
Map is a set interface of key-value pairs, and its implementation classes mainly include: Hashmap,treemap,hashtable and Linkedhashmap.TREEMAP: Based on the navigablemap implementation of the red-black tree (red-black trees), the map is sorted
1.1 Higher order functionsVariables can point to functions>>> ABS (-10)10>>> x = ABS--x points to abs function>>> x ( -1)-- call X directly1Call ABS and call x exactly the same. The function name is also a variable>>> ABS = 10>>> ABS
One: Cause(1) Java map Sort (key,value), see another blog Java map sort(2) C + + map ordering (key,value), you can compare C + + map and Java map: one,C + + map By default according to the key value of the order, and is the map ; Java Map HashMap is
---map ()First look at the map () function, the map function accepts two parameters, the first parameter is the algorithm, the second parameter is a specific value (note that the value must be iterative). That is, map (fun,iterable)The map function
Map, set, list, and so on.
Preface:Today, I think of a set of map, set, list, and other materials, so I took some notes and provided them for your reference and future review.
First, Map is mainly used to store the key-value pairs and obtain values
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.